//: enumerated/RoShamBo2.java
// Switching one enum on another.
package base.enumtest.fenfa;

public enum RoShamBo2 implements Competitor<RoShamBo2> {
	PAPER(Outcome.DRAWN, Outcome.LOSE, Outcome.WIN), SCISSORS(Outcome.WIN,
			Outcome.DRAWN, Outcome.LOSE), ROCK(Outcome.LOSE, Outcome.WIN,
			Outcome.DRAWN);
	private Outcome vPAPER, vSCISSORS, vROCK;

	RoShamBo2(Outcome paper, Outcome scissors, Outcome rock) {
		this.vPAPER = paper;
		this.vSCISSORS = scissors;
		this.vROCK = rock;
	}

	public Outcome compete(RoShamBo2 it) {
		switch (it) {
		default:
		case PAPER:
			return vPAPER;
		case SCISSORS:
			return vSCISSORS;
		case ROCK:
			return vROCK;
		}
	}

	public static void main(String[] args) {
		RoShamBo.play(RoShamBo2.class, 20);
	}
	
}
